<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script type="text/javascript">
        var stu1 = new Student("smyh");
        console.log(stu1);
        stu1.sayHi();
        var stu2 = new Student("vae");
        console.log(stu2);
        stu2.sayHi();

        function Student(name) {
            this.name = name;
            this.sayHi = function() {
                console.log(this.name + "厉害了");
            }
        }
    </script>
</body>

</html>